package com.example.demo111111.controller;


import com.example.demo111111.Result.PageResult;
import com.example.demo111111.entity.AuditProduct;
import com.example.demo111111.entity.Product;
import com.example.demo111111.service.AuditProductService;
import com.example.demo111111.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@RestController
@RequestMapping("/auditproduct")
public class AuditProductController {
    @Autowired
    private AuditProductService auditProductService;
    @PostMapping
    public Boolean save(@RequestBody AuditProduct product){

        Boolean result= auditProductService.save(product);
        return result;

    }

    @PutMapping
    public Boolean update(@RequestBody AuditProduct product){
        Boolean result= auditProductService.update(product);
        return result;
    }

    @GetMapping ("/pageQuery")
    public PageResult pageQuery(AuditProduct product){
        PageResult pageResult= auditProductService.pageQuery(product);
        return pageResult;
    }
    //批量删除
    @DeleteMapping
    public Boolean delete(@RequestParam List<Long> ids) {
        Boolean result= auditProductService.deltete(ids);
        return result;
    }




}
